<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<script src="js/axios.min.js"></script>
		<title></title>
	</head>
	<body>
		<button id="TestPOST">POST</button>
		<button id="TestGET">GET</button>
	</body>
	<script>
		document.getElementById('TestPOST').addEventListener('click', function() {
		  axios.post('./api/API.php?OP=Landing', {
			  Account:"admin",
			  PassWord:"123456",
		  	})
		  	.then(response => {
		  		console.log(response.data)
		  	})
		  	.catch(function(error) {
		  		console.log(error);
		  	});
		});
		document.getElementById('TestGET').addEventListener('click', function() {
		  axios.post('./api/Controller.php?ac=ITE&token=' + this.$props.token + '', {
		  		id: this.form.fid,
		  		title: this.form.ftitle,
		  		author: this.form.fauthor,
		  		content: this.form.fcontent,
		  	})
		  	.then(response => {
		  		console.log(response.data)
		  		this.$notify.success({
		  			title: '成功',
		  			message: '修改成功！'
		  		});
		  		this.$refs.etp.style.display = "none";
		  		this.$refs.etpx.style.display = "block";
		  		this.$refs.Nstory.style.display = "none";
		  		this.ftabledata = [];
		  		this.ftabledata = response.data[0];
		  		this.$emit('update:token', response.data[1]);
		  		//数据双向绑定
		  		//this.$emit('update:token', response.data);
		  	})
		  	.catch(function(error) {
		  		console.log(error);
		  	});
		});
	</script>
</html>